package com.nuoniu.sibanyun.controller.finance;


import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.finance.VAccountingSearchProgramme;
import com.nuoniu.sibanyun.service.finance.IVAccountingSearchProgrammeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 科目总账查询方案表 前端控制器
 * </p>
 *
 * @author 小啊刚
 * @since 2021-05-08
 */
@RestController
@RequestMapping("/finance/accountingSearchProgramme")
@Api(tags = "科目总账查询方案")
public class VAccountingSearchProgrammeController extends BaseController {

    @Autowired
    private IVAccountingSearchProgrammeService searchProgrammeService;

    @ApiOperation("保存方案")
    @PostMapping("save")
    public HttpResult save(@RequestBody VAccountingSearchProgramme searchProgramme) {
        searchProgrammeService.saveProgramme(searchProgramme);
        return HttpResult.ok();
    }

    @ApiOperation("获取方案列表")
    @GetMapping("getList")
    public HttpResult getList(Integer type) {
        return HttpResult.ok(searchProgrammeService.getList(type));
    }

    @ApiOperation("删除方案")
    @DeleteMapping("delete")
    public HttpResult delete(Long id) {
        searchProgrammeService.removeById(id);
        return HttpResult.ok();
    }
}
